<!--  -->
<template>
 
    <div class="share-order">
      <div class="content-wrapper" v-html="content"></div>
      <div class="customer">
        <router-link
          tag="div"
          :to="{name:'service',query:{shop_id:shopId}}"
          class="consultation flex justify-center aligin-center"
        >客服咨询</router-link>
        <div class="tip-text">周一～周五 9:00-21:00</div>
      </div>
    </div>
  
</template>

<script>
import{ lotteryDetail } from "../api/api";
export default {
  components: {},
  props: {
    activityId: {
      type: Number,
      default: () => {
        return 0;
      },
      required: true
    },
    shopId:{
      type:Number,
      default:()=>{
        return 29
      }
    }
  },

  data() {
    return {
      content: ""
    };
  },
  computed: {},
  watch: {},
  methods: {
    _api() {
      lotteryDetail({ id: this.activityId }).then(res => {
        const regex = new RegExp("<img", "gi");
        this.content = res.data.result.active_detail.replace(
          regex,
          `<img style="max-width: 100%; height: auto;display:block"`
        );
      });
    },
    request() {
      this._api();
    }
  },
  created() {},
  mounted() {
    this.request()
  },
  updated() {}, //生命周期 - 更新之后
  destroyed() {} //生命周期 - 销毁完成
};
</script>
<style lang='less' scoped>
@import url("../assets/style/mixin"); //引入公共css类
.mask {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0.4;
  z-index: 30;
}
.share-order {
   padding: 90px 14px 0;
  width: 100%;
  height:100%;
  box-sizing: border-box;
  z-index: 32;
  background: #fff;
  transition: all 0.3s ease;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  .share-icon {
    width: 24px;
    height: 24px;
    .bg-image("../../assets/imgs/share-order");
    background-size: 100% 100%;
  }
  .close {
    height: 16px;
    width: 16px;
    .bg-image("../../assets/imgs/close-dialog");
    background-size: 100% 100%;
  }
}
.show {
  height: 543px;
}
.content-wrapper {
  height: calc( 100% - 88px);
  overflow: auto;
}
.customer {
  padding: 10px 0 6px;
  height: 0;
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid #f0474f;
  transition: all 0.3s ease;
  z-index: 999;
  .consultation {
    margin: 0 auto;
    width: 110px;
    height: 28px;
    background: rgba(240, 71, 79, 1);
    border-radius: 5px;
    font-size: 15px;
    color: #fff;
  }
  .tip-text {
    margin-top: 9px;
    font-size: 12px;
    color: rgba(240, 71, 79, 1);
    text-align: center;
  }
}
.customer-show {
  height: 64px;
}
</style>